#ifndef STRING_H
#define STRING_H

#include <iostream>
#include "CommonVector.h"

class CommonString
{
public:
	CommonString() {}
	CommonString(const char* aStr) : mString(aStr) {}
	CommonString(const CommonVector<char>& aVec) 
	{
		for (CommonVector<char>::const_iterator it = aVec.begin(); it != aVec.end(); ++it)
		{
			mString += *it;
		}
	}

	CommonString (const CommonString& str) : mString(str.mString) {}
	CommonString (const CommonString& str, size_t pos, size_t len = std::string::npos) : mString(str.mString, pos, len) {}
	CommonString (const char* s, size_t n) : mString(s, n) {}
	CommonString (size_t n, char c) : mString(n,c) {}
	
	CommonString& operator= (const CommonString& str) { mString = str.mString;  return *this; }
	CommonString& operator= (const char* s) {mString = s;  return *this; }
	CommonString& operator= (char c) { mString = c; }

	CommonString& operator+= (const CommonString& str) { mString += str.mString;  return *this; }
	CommonString& operator+= (const char* s) {mString += s;  return *this; }
	CommonString& operator+= (char c) { mString += c;  return *this; }
	
	const std::string& GetStdString() const { return mString; }
	std::string& GetStdString() { return mString; }
private:
	std::string mString;
};

#endif //OUTPUT_H